<template>
  <!-- 朱玉豪 -->
  <div class="container">
    <!-- 添加底部导航阴影 -->
    <!-- 添加底部阴影end -->
				<slider class="slider" interval="3000" auto-play="true" :index="0" >
						<div class="slider-frame"  v-for="(img, idx) in imageList" :key="idx+ 1/2">
							<image class="slider-frame-image" resize="cover" :src="img.pic" @click="bannerLink(img.url, img.type)"></image>
						</div>
						<indicator class="indicator"></indicator>
      	</slider> 
			<div class="activites">
				<div class="activites_box">
					<div class="activites_box_item" v-for="(img,index) in activities" :key="index+1/3" @click="routeract(img.href)">
						<image class="activites_box_item_img" :src="img.img" :alt="img.name"></image>
						<text class="activites_box_item_name">{{img.name}}</text>
					</div>
				</div>
			</div>
     <div class="notice-bar">
        <div class="notice-bar-title">
            <image class="notice-bar-title-titleT-img" src="https://goucai-app.oss-cn-beijing.aliyuncs.com/home/kuaibao.png"></image>
        </div>
			<div class="notice-bar-fixed-area">
				<div class="notive-bar-area" v-if="priceMans.length > 0">
						<slider class="notice-slider" interval="5000" auto-play="true" :index="0">
						<div class="notice-bar-msg"  v-for="(item,index) in priceMans" :key="index+1/6">
							<!-- <text class="notice-bar-msg-1"> {{item.pic}} </text> -->
							<text class="notice-bar-msg-c">恭喜</text>
							<text class="notice-bar-msg-1"> {{item.nickname}} </text>
							<text class="notice-bar-msg-c">购买</text>
							<text class="notice-bar-msg-c">{{item.lotteryName}}</text>
							<text class="notice-bar-msg-3"> 喜中{{item.userPrize}}元</text>
						</div>
						</slider>
				</div>
				<div class="notive-bar-area" v-if="priceMans.length === 0">
					<text  class="notice-bar-msg-c">暂无消息</text>
				</div>
			</div>
      	</div>
		<div class="betone">
			<div class="betone-title">
				<div class="betone-title-left">
					<text class="betone-title-left-title">{{recentBuyTitle}}</text>
				</div>
				<text class="betone-title-leftopentime">{{recentBuyTime}}</text>
				<div class="betone-refresh-img" @click="refreshBalls">
			  	<text class="betone-refresh-name" ref="refreshBalls" >换一注</text>
			  	<image class="betone-refresh-image" src="https://goucai-app.oss-cn-beijing.aliyuncs.com/home/change.png" alt="refresh"></image>
		  	</div>
			</div>
			<short-super-lotto v-if="userInfo.recentBuyTypeNum === 2"  ref="randomLotteryEvent"   @getRandow="getValue"></short-super-lotto>
			<short-union-lotto v-if="userInfo.recentBuyTypeNum === 1"   ref="randomLotteryEvent"   @getRandow="getValue"></short-union-lotto>
			<shortLotto3d v-if="userInfo.recentBuyTypeNum === 3"   ref="randomLotteryEvent"   @getRandow="getValue1"></shortLotto3d>
			<shortPaiThree v-if="userInfo.recentBuyTypeNum === 4"   ref="randomLotteryEvent"   @getRandow="getValue1"></shortPaiThree>
			<shortPaiFive v-if="userInfo.recentBuyTypeNum === 5"   ref="randomLotteryEvent"   @getRandow="getValue1"></shortPaiFive>
			<div class="betone-numbers-button">
				<text  class="betone-numbers-button-name" @click="gobet()">立即投注</text>
			</div>
			
		</div>
      <div class="hotlots">
        <div class="hotlots-title">
          <div class="hotlots-title-left">
            <text class="hotlots-title-left-name">热门彩种</text>
          </div>
          <div class="hotlots-title-right">
            <text class="betone-refresh-name">更多彩种</text>
            <image class="hotlots-title-right-moreimg" src="https://goucai-app.oss-cn-beijing.aliyuncs.com/home/bar-right.png" alt=""></image>
          </div>
        </div>
        <div class="hotlots-lots">
          <div class="hotlots-lot" v-for="(item,index) in hotlots" :key="index" v-on:click="router(item)">
            <image class="hotlots-lot-img" :src="item.img" alt=""></image>
            <text class="hotlots-lot-name">{{item.name}}</text>
          </div>
        </div>
      </div>
   	<loading-big v-if="loadingshow"></loading-big>
    <!-- 导航 -->
	
  </div>
</template>

<style scoped>
.slider-frame1{
	/* opacity: 0; */
	position:absolute;
	left:-2000px;
	top:-3000px;
	 width: 750px;
  height: 368px;
}
.scroller {
	flex:1;
	width: 750px;
	
  /* 
  position: fixed;
  top:0;
  bottom: 100px;
  left: 0;
  right: 0; */
}
.notive-bar-area {
  flex-direction: row;
  /* margin-left: 550px; */
}
.notice-bar-fixed-area {
  width: 555px;
  overflow: hidden;
}






.indicator {
  width: 750px;
  height: 40px;
  item-color: white;
  item-selected-color: #076bf2;
  item-size: 14px;
  position: absolute;
  bottom: 10px;
  right: 0px;
}
.indicator >>> .weex-indicator-item {
  width: 32px;
  height: 4px;
}

.hotlots-lot-img {
  width: 90px;
  height: 90px;
  align-self: center;
}
.hotlots-lot-name {
  margin-top: 25px;
  font-size: 24px;
  text-align: center;
  align-items: center;
}
.hotlots-lot {
  width: 140px;
  margin-bottom: 65px;
}
.hotlots-lots {
  flex-wrap: wrap;
  padding-top: 40px;
  padding-right: 1px;
  padding-bottom: 40px;
  padding-left: 1px;
  justify-content: space-between;
  flex-direction: row;
}
.hotlots-title-left-hr {
  width: 6px;
  background-color: #e70d0d;
  margin-right: 10px;
  height: 30px;
  align-self: center;
}
.hotlots-title-left {
  flex-direction: row;
}
.hotlots-title-left-name {
  align-self: flex-end;
  font-size: 32px;
  color: #333333;
}
.hotlots-title-right-moreimg {
  height: 40px;
  width: 40px;
  align-self: center;
  margin-left: 5px;
}
.hotlots-title-right {
  flex-direction: row;
}
.hotlots-title {
  justify-content: space-between;
  flex-direction: row;
}
.hotlots {
  background-color: #fff;
  padding-top: 24px;
  padding-bottom: 24px;
  padding-right: 30px;
  padding-left: 30px;
  margin-top: 24px;
}
/* lottos */
/* betone */
.betone-refresh-name {
  font-size: 24px;
  color: #666;
  font-family:PingFangSC-Regular;
	align-self: center;
}
.betone-refresh-image {
  height: 44px;
  width: 44px;
  align-self: center;
  margin-left: 10px;
}
.betone-refresh-img {
  position: absolute;
  right: 0;
  top:0;
  flex-direction: row;
	justify-content: flex-end;
}
.betone-numbers-button-name {
  color: #fff;
  font-size: 30px;
  text-align: center;
}
.betone-numbers-button {
  align-self: center;
  width: 218px;
  height: 72px;
  border-radius: 50px;
  background-color: #fe0202;
  /* background: linear-gradient(-90deg, #f74d4d 0%, #fe0202 51%, #f75050 100%); */
  box-shadow: 0px 3px 5px 2px #fbb8b8;

  justify-content: center;
}
.betone-numbers-bGroup-forward {
  background-color: #e70d0d;
}
.betone-numbers-bGroup-backward {
  background-color: #076bf2;
}
.betone-numbers-bGroup-span-t {
  font-size: 32px;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}
.betone-numbers-bGroup-span {
  height: 64px;
  width: 64px;
  border-radius: 50px;
  flex-direction: column;
  justify-content: center;
}
.betone-numbers-bGroup {
  justify-content: space-between;
  flex-direction: row;
  flex: 0 0 100%;
}
.betone-numbers {
  flex-wrap: nowrap;
  padding-top: 40px;
  padding-bottom: 40px;
  padding-right: 18px;
  padding-left: 18px;
  flex-direction: row;
  justify-content: space-between;
}
.betone-title-leftopentime {
  font-size: 24px;
  margin-left: 20px;
  color: #666;
  align-self:center;
}
.betone-title-left-hr {
  width: 6px;
  background-color: #e70d0d;
  margin-right: 10px;
  height: 30px;
  align-self: center;
}
.betone-title-left-title {
  align-self: flex-end;
  font-size:34px;
  font-family:PingFangSC-Medium;
  color: #333333;
}
.betone-title-left {
  flex-direction: row;
}
.betone {
  padding-top: 28px;
  padding-bottom: 30px;
  padding-right: 30px;
  padding-left: 30px;
  background-color: #fff;
  margin-top: 24px;
}
.betone-title {
  font-size: 25px;
  flex-direction: row;
	position: relative;
}
/* betone */
/* notice */
.notice-bar-msg-c {
  font-size: 26px;
  color: #333333;
}
.notice-bar-msg-1 {
  /* color: #fd8509; */
  font-size: 26px;
  color: #333333;
}
.notice-bar-msg-3 {
  color: red;
  font-size: 26px;
  font-weight: bold;
}
.notice-bar-msg {
  border-radius: 4px;
  color: #000;
  /* flex: 60%; */
  align-items: center;
  flex-direction: row;
  font-size: 24px;
  display: flex;
  height: 45px;
  /* margin-left: 50px; */
}
.notice-bar-title-titleT-span2 {
  font-family: Helvetica;
  font-size: 36px;
}
.notice-bar-title-titleT-span1 {
  font-family: Helvetica;
  color: #e70d0d;
  font-size: 36px;
}
.notice-bar-title-titleT-img {
  width: 113px;
  height: 36px;
}
.notice-bar-title-img {
  height: 30px;
  width: 30px;
  align-self: center;
  margin-left: 17px;
  margin-right: 12px;
}

.notice-bar-title {
  flex-direction: row;
  align-items: center;
	margin-right: 20px;
}
.notice-bar {
  background-color: #fff;
  padding-top: 25px;
  padding-bottom: 25px;
  padding-right: 30px;
  padding-left: 30px;
  flex-direction: row;
  align-items: center;
  height: 95px;
  display: flex;
}
/* notice */
/* act */
.activites_box_item_img {
  width: 118px;
  height: 118px;
  align-self: center;
}
.activites_box_item_name {
  font-size: 24px;
  color: #333;
  text-align: center;
}
.activites_box {
  flex-direction: row;
  flex-wrap: nowrap;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: #e6e6e6;
  color: #444;
  padding-top: 0;
  padding-bottom: 30px;
  padding-right: 30px;
  padding-left: 30px;
  justify-content: space-between;
  margin-top: 10px;
}
.activites {
  background-color: #fff;
  padding-top: 20px;
  padding-bottom: 0;
  padding-right: 30px;
  padding-left: 30px;
}
.activites_box_item {
  flex-direction: column;
  font-size: 25px;
  text-align: center;
}
/* act */
.slider-frame-image {
  width: 750px;
  height: 368px;
}
.slider {
  width: 750px;
  height: 368px;
}
.slider-frame {
  width: 750px;
  height: 368px;
  position: relative;
}
.notice-slider {
  width: 600px;
  height: 45px;
}
.container {
  background-color: #f5f5f5;

}
</style>

<script>

import { serialize, getBaseUrl } from "@/utils/index.js";
import { WxcCity } from "weex-ui";
import { Utils } from "weex-ui";
import { customResponse, postResponsesToken, GetResponsesToken } from "@/api.js"

const modal = weex.requireModule("modal");
const dom = weex.requireModule("dom");
const animation = weex.requireModule("animation");
const navigator = weex.requireModule("navigator");
const storage = weex.requireModule("storage");
const sxglobalEvent = weex.requireModule("globalEvent");

import WxcLoadingsp from "../../components/modules/loading";
import shortSuperLotto from "../../components/modules/shortcutLotto/short-super-lotto";
import shortUnionLotto from "../../components/modules/shortcutLotto/short-union-lotto";
import shortLotto3d from "../../components/modules/shortcutLotto/short-lotto3d";
import shortPaiThree from "../../components/modules/shortcutLotto/short-paithree";
import shortPaiFive from "../../components/modules/shortcutLotto/short-paifive";
import WxcMinibar from "@/components/modules/wxc-minibar/index.js";

import goucai from "../../js/components/module.js";
import { recentBuyGroup, activities, hotlots} from "@/js/global/index_data.js"
import loadingBig from "@/components/modules/loading-big";

export default {
	components: {
			WxcMinibar,
			WxcCity,
			WxcLoadingsp,
			shortSuperLotto,
			shortUnionLotto,
			shortLotto3d,
			shortPaiThree,
			shortPaiFive,
			loadingBig
	},
	data() {
		return {
			imgShow:false,
			count:0,//表明图片轮播加载的完的张数
			percentNum:0,
			url:"http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/bannerMo.png",
			recentBuyGroup: recentBuyGroup ,
			activities: activities,
			hotlots: hotlots,
			loadingshow: false,
			eventCnt: 0,
			hint: "",
			currentCity: "选择城市",
			priceMans: [],
			imageList: [],
			betOne: {
				type: "super-lotto",
				numberType: "8",
				forward: [],
				backward: [],
				jwBall: {}
			},
			userInfo: {
				recentBuyType: "super-lotto",
				recentBuyTypeNum: 2,
				recentBuyTypeSS:'DLT',
			},
			
		}
	},
	watch:{
		percentNum(val){
			if(val===100){//图片全部加载完
				this.imgShow=true;
			
			}
		}
	},
  methods: {
		onImageLoad(){
			this.count++;
			this.percentNum = Math.floor(this.count / this.imageList.length * 100);
			console.log(this.percentNum);
		},
		
		showdom(){
				storage.getItem('token', event=>{
					if(!event.result || event.data == 'undefined') {
						navigator.push({
							'url': this.baseURL + 'views/login/login.js',
							'animated': 'true'
						})
					}else{
							navigator.push({
							'url': this.baseURL + 'views/message/message.js',
							'animated': 'true'
						})
					}
				})
		},
		getStorage(name) {
			//获取name的缓存信息
			return new Promise((resolve, rejects) => {
				storage.getItem(name, event => {
					resolve(event);
				})
			})
		},
		setStorage(name, value) {
			//设置name的缓存信息value
			return new Promise((resolve, rejects) => {
				storage.setItem(name, value, event => {
				if (event.result === "success") {
					resolve(1);
				} else {
					rejects(0);
				}
				});
			});
		},
		
		// 获取缓存数据
		getCacheMark() {
			return new Promise((resolve, rejects) => {
				storage.getItem("paiThreeList", event => {
					if (event.result === "success") {
						resolve(event.data)
					} else {
						resolve(false)
					}
				});
			});
		},
		//缓存数据
		cacheMark(value) {
			return new Promise((resolve, rejects) => {
				storage.setItem("paiThreeList", JSON.stringify(value), event => {
					if (event.result === "success") {
						resolve(true);
					} else {
						modal.confirm({message:'缓存数据失败'})
					}
				})
			})
		},

		Confirm(question) {
			return new Promise((resolve, reject) => {
				modal.confirm({
					message: question,
					okTitle: "确定",
					cancelTitle: "取消",
					duration: 0.3
				},(value)=>{
					resolve(value);
				})
			});
		},

		
		
		
		
		async gobet() {
			this.removeCachePaiThreeList();
			let token = await this.getStorage("token");

			if (token.data === "undefined") {
				navigator.push({
					url: this.baseURL + `views/login/login.js`,
					animated: "true"
				})
			}
			
			await this.getHistory(this.userInfo.recentBuyTypeSS);

			let canbuy = this.recentBuyGroup.filter(x => x.type === this.betOne.type)[0]


			if (canbuy.canBuy === false) { return modal.toast({ message: "暂无销售" })}

			this.payMent(canbuy);
		},

		random(start, end, choseNum) {

			let randoms = [];
			while (true) {
				let isExists = false;
				// 获取一个1–35范围的数
				let a = (start + end * Math.random()).toString();
				let random = parseInt(a);
				// 判断当前随机数是否已经存在
				for (let i = 0; i < randoms.length; i++) {
					if (random === randoms[i]) {
						isExists = true;
						break;
					}

				}
				if (!isExists) randoms.push(random)

				if (randoms.length === choseNum) {
					return randoms;
				}
			}
		},

		getValue1(value) {
			this.betOne.jwBall = value.ballarr;
		},

		getValue(value) {
			this.betOne.forward = value.redArray;
			this.betOne.backward = value.buleArray;
		},

		refreshBalls() {
			this.$refs.randomLotteryEvent.times();
		},
		

		// formatNum(num) {
		// 	console.log(num)
		// 	return num < 10 ? "0" + num : num.toString()
		// },

		removeCacheMark() {
			return new Promise((resolve, rejects) => {
				storage.removeItem("markList", event => {
				if (event.result === "success") {
					resolve("ok");
				} else {
					rejects("删除缓存数据失败!");
				}
				});
			});
		},

		removeCachePaiThreeList() {
			return new Promise((resolve, rejects) => {
				storage.removeItem("paiThreeList", event => {
				if (event.result === "success") {
					resolve("ok");
				} else {
					rejects("删除缓存数据失败!");
				}
				});
			});
		},

		async routeract(href) {
			if(href === 'consult') {
				navigator.push({
					url: this.baseURL + `views/${href}/${href}.js`,
					animated: "true"
				})
				return false
			}


			let token = await this.getStorage("token");
			if (token.data === "undefined") {
				this.loadingshow = false;
				modal.toast({
					message: "请登录"
				});

				navigator.push({
					url: this.baseURL + `views/login/login.js?`,
					animated: "true"
				});
				return;
			}
			
			if (href === "") {
					modal.toast({
					message: "暂未开放，敬请期待",
					duration: 1

				});

				return;
			}
			
			navigator.push({
				url: this.baseURL + `views/${href}/${href}.js`,
				animated: "true"
			});
		},
		async router(item) {
			let token = await this.getStorage("token");
			if (token.data === "undefined") {

				this.loadingshow = false;
					modal.toast({
					message: "请登录"
				});
				navigator.push({
					url: this.baseURL + `views/login/login.js?`,
					animated: "true"
				})
				return;
			}

			if (item.href === "") {
				return;
			}

			let hash = {
				pageType: item.href,
				typeName: item.type,
				type: !!item.type ? item.type : ""
			};
			// return modal.alert({message:JSON.stringify(hash)});
			this.removeCacheMark();
			this.removeCachePaiThreeList();

			navigator.push({
				url: this.baseURL + `views/lottery/lottery.js?` + serialize(hash),
				animated: "true"
			});
		},
		
		
		async getHistory(value) {

			let data = await GetResponsesToken('lottery/issue/queryCurIssue/'+ value)

			if( typeof data.data.issue === 'string' ) {
				this.recentBuyGroup.filter( x => x.Id === this.userInfo.recentBuyTypeNum)[0].canBuy = false
			} else {
				this.recentBuyGroup.filter(x => x.Id === this.userInfo.recentBuyTypeNum)[0].currentIssue = data.data.issue
			}
		},
		formatNum(num) {
			return num.map(x=> x < 10 ? "0" + x : x.toString())
		},

		formatMarklist(markList){
			let numType = markList.type
			let copymark = JSON.parse(JSON.stringify(markList))
			let parma = {
				'lotto3d': '1',
				'paiThree':'1',
				'paiFive': '5'
			}

			let typeFn = {
				'super-lotto': 'welfareLotto',
				'union-lotto': 'welfareLotto',
				'lotto3d': 'ArrangeLotto',
				'paiThree': 'ArrangeLotto',
				'paiFive': 'ArrangeLotto',
			}

			let finalContent = []

			
			finalContent.push(this[typeFn[numType]](copymark, parma[numType]))

			return finalContent
		},

		welfareLotto( copymark ) {
			return {
				redBall:this.formatNum(copymark.forward),
				blueBall:this.formatNum(copymark.backward),
				danRedBall:[],
				danBlueBall:[],
				type:'recurren',
				numberType:'8',
				money:2,
				number:1
			}
		},

		ArrangeLotto(copymark, betoneNumbertype) {
			return {
				wan: copymark.jwBall.wan || [],
				thousand: copymark.jwBall.thousand || [],
				hundred: this.formatNum(copymark.jwBall.hundred),
				ten: this.formatNum(copymark.jwBall.ten),
				ge: this.formatNum( copymark.jwBall.ge),
				numberType: betoneNumbertype,
				type:'basisM',
				number:1,
				money:2,
				title:'直选'
			}
		},

		// 跳转支付
		async payMent(c_issue) {
			this.loadingshow = true

			let betoneContent = await this.formatMarklist(this.betOne)

			let markList =[]
			let lottoId = c_issue.Id;
			let lottoname = c_issue.name;

			let reqBody = {
				lotteryNo: c_issue.typeName, //
				buyTogether: 0, //是否合买
				schemeNumberUnit: '1', //注数
				issueSum: '1', //总共期数
				// issueId: c_issue.currentIssue.id, //奖期id
				issueIssue: c_issue.currentIssue.issue, //奖期
				multiple: 1, //倍数
				money: '2', //方案金额
				buyMoney: "0", //认购金额
				betContent: JSON.stringify(betoneContent), //投注内容
				isChase: 0, //是否追号 0不追 1追号
				append: 0, //是否追加 0否 1追加(大乐透)

			};

			// try {
				this.loadingshow = false;

				// let req = await postResponsesToken('order/bet/bet', reqBody);
				// if( req.code === 0) {
					
				let hash = Object.assign(reqBody, {
					totalmoney: 2,
					lottotype: lottoname + c_issue.currentIssue.issue + "期",
					lottoId: lottoId.toString()
				})
	

				navigator.push({
					url: this.baseURL + `views/pay/pay.js?` + serialize(hash),
					animated: "true"
				})
			// 	} else {
			// 		modal.toast({ message: data.msg })
			// 	}
				

			// } catch (e) {
			// 	this.loadingshow = false
			// 	modal.toast({ message: e })
			// }
		},

		// 根据用户是否登录选择获取数据渠道 
		judegIndex() {
			let reqHeader =  { 
				url:'account/user/index',
				params:'',
				type:'GET', 
				header:{
					"Content-Type": "application/json;charset=utf-8"
				}
			}
			
			storage.getItem('authorization', event => {

				if (event.result === 'success') {
					reqHeader.url = 'account/user/index?isLogin=1'
					reqHeader.header = {
						"Content-Type": "application/json;charset=utf-8",
						'Authorization': event.data
					}
				}

				this.getIndexDate(reqHeader, event.result === 'success')
			})
		},

		// 获取首页数据
		async getIndexDate(reqHeader, state) {
			let data = await customResponse(reqHeader)

			if( data.code === 0) {
				this.imageList = data.data.bannerList;
				// this.preloadImg(data.data.bannerList);
				this.getUserRecentBuy(data.data.lotteryNo)
				this.getNoticeMans(data.data.bulletinList)
			}	
		},

		// 图标跳转
		bannerLink(url, type) {
			if(type == 2) {
				navigator.push({
						url: `${this.baseURL}${url}.js`,
						animated: "true"
				})
			} else {//跳外部的h5
				  let baseurl =  getBaseUrl(weex.config.bundleUrl, true);
					let urlParmas = {
						url: url
					}
					let jUrl = baseurl + `views/webview/conview_webview.js?` + serialize(urlParmas);
					let params = {
						url: jUrl,
						animated: "true"
					};
					navigator.push(params);
					return;
			}
			

			// url 跳转页面， type判断是h5还是app
		},

		//获取用户最近购买信息
		getUserRecentBuy(data) {
			// 彩种分类
			let param = {
				'SSQ' : 1,
				'DLT': 2,
				'FC3D' : 3,
				'PL3': 4,
				'PL5' : 5
			}

			this.betOne.type = this.userInfo.recentBuyType;

			this.userInfo.recentBuyType = goucai.lottoSwitchtypes(param[data]);
			this.userInfo.recentBuyTypeNum = param[data]
			this.userInfo.recentBuyTypeSS = data;
			// modal.alert({message:JSON.stringify(this.userInfo)});
			this.betOne.type = this.userInfo.recentBuyType
			this.refreshBalls()

			// this.getHistory(data);
		},

		// 获取最近十人快报
		getNoticeMans(data) {
			this.priceMans = data
			// this.priceMans = data.map( value => JSON.parse(value))
		},

	},

	created() {
	
		//前缀地址
		this.baseURL = getBaseUrl(weex.config.bundleUrl, true);
		
		// 获取首页相关信息
		this.judegIndex()
		
		
	},
	destroyed() {
		sxglobalEvent.removeEventListener("sxlocation");
	},
	computed: {
		recentBuyTitle() {
			return this.recentBuyGroup.filter(  x => x.type === this.userInfo.recentBuyType)[0].name;
		},
		
		recentBuyTime() {
			return this.recentBuyGroup.filter( x => x.type === this.userInfo.recentBuyType)[0].time;
		},
		
		betOneSortForward() {
			return goucai.ballSort(this.betOne.forward);
		},
		
		betOneSortBackward() {
			return goucai.ballSort(this.betOne.backward);
		},
		
		pageHeight() {
			return { height: Number(this.contentStyle.height.split("px")[0]) - 30 + "px" }
		}
	}
};
</script>

